package modularity.passiveDrift;

import ec.util.MersenneTwisterFast;

/**
 * using ECJ's mersenne twister as the random number generator
 * see http://cs.gmu.edu/~eclab/projects/ecj/docs/classdocs/index.html for details.
 * 
 * @author fernando
 *
 */
public class ExtendedMersenneTwister extends MersenneTwisterFast{

	private static final long serialVersionUID = 1L;
	private int nodeCount;
	
	public synchronized void setNodeCounter(int currentCount){
		this.nodeCount = currentCount;
	}
	
	public synchronized int generateNextNodeId(){
		nodeCount++;
		return nodeCount;
	}
	
	public synchronized int getCurrentNodeCount(){
		return nodeCount;
	}
	
	public synchronized double getNextDouble(){
		return super.nextDouble();
	}

	public synchronized int getNextInt(int limit){
		return super.nextInt(limit);
	}
}
